import {G6GraphEvent, Graph, INode} from '@antv/g6';
import GraphEventName from '../consts/graph-event-name';

export default function (graph: Graph) {
    graph.on('canvas:drag', (event: G6GraphEvent) => {
        // console.log('common:mouseup');
        // graph.getNodes().forEach(node => {
        //     node.lock();
        // });
        // console.log('canvas:drag');
    });
    graph.on('canvas:mousedown', (event: G6GraphEvent) => {
        // console.log('common:mouseup');
        // graph.getNodes().forEach(node => {
        //     node.lock();
        // });
        graph.emit(GraphEventName.ITEMS_CLEAR_SELECT);
        graph.emit(GraphEventName.ITEM_CLEAR_SELECTED);
    });
    graph.on('canvas:dr', (event: G6GraphEvent) => {
        // console.log('common:mouseup');
        // graph.getNodes().forEach(node => {
        //     node.lock();
        // });
        graph.emit(GraphEventName.ITEMS_CLEAR_SELECT);
        graph.emit(GraphEventName.ITEM_CLEAR_SELECTED);
    });
}
